#!/usr/bin/perl 

BEGIN {
	push @INC,"/usr/local/cluster/lib/perl";
}

use clutils qw(netlist get_node_ssh_ip validate_cluster_cfg);

($xml,$err,@errmsg)=validate_cluster_cfg("/etc/cluster/clconf.xml",0);
if(!defined($xml)) {
	print STDERR "Error - unable to read cluster configuration.\n";
	exit(1);
}

($rnode_ip,$rnode_msg)=get_node_ssh_ip(timeout=>2,xml=>$xml);
if(!defined($rnode_ip)) {
	print STDERR "No SSH route found!\n";
	exit(1);
}

print "SSH route found: $rnode_ip\n";
exit(0);
